﻿using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace EAS.Content.Buffs
{
    public class BleedingDebuff : ModBuff
    {
        public override void SetStaticDefaults()
        {            
            Main.debuff[Type] = true;
            Main.pvpBuff[Type] = true;
            Main.buffNoSave[Type] = true;
        }

        public override void Update(NPC npc, ref int buffIndex)
        {
            int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 1f);
            Main.dust[dust].velocity *= 0.5f;
            Main.dust[dust].scale *= 1.2f;
            Main.dust[dust].noGravity = true;
            npc.lifeRegen -= (int)(npc.lifeMax * 0.1f);
        }
    }
}
